import {
  createRouter,
  createWebHistory
} from 'vue-router'
import layout from '@/layout/default.vue'

const router = createRouter({
  history: createWebHistory(
    import.meta.env.BASE_URL),
  routes: [{
    path: '/',
    redirect: '/home',
    component: layout,
    children: [{
        path: 'home',
        name: 'home',
        component: () => import('@/views/home/index.vue'),
      },
      {
        path: 'demo',
        name: 'demo',
        component: () => import('@/views/demo/index.vue'),
      },
    ],
  }]
})

export default router
